<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" 
uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${sessionScope.user!=null}">
<div id="header" class="wrap">
	<div>
	<div id="logo" style="float:left">北大青鸟网上书城</div>
	<div style="float:right;padding:15px">
	当前用户:<b>${sessionScope.user.username}</b></div>
	</div>
	<div id="navbar" style="clear:both">
		<div class="userMenu">
			<ul>
				<li><a href="book.do">User首页</a></li>
				<li><a href="item.do">我的订单</a></li>
				<li><a href="shopping.jsp">购物车</a></li>
				<li><a href="user.do?opt=logout"
					onclick="return confirm('确定注销??');">注销</a></li>
			</ul>
		</div>
		<form method="post" name="search" action="book.do">
			搜索：<input class="input-text" 
			type="text" name="name" value="${name}" />
			<input name="p" id="txtp"  type="hidden" > 
			<input class="input-btn" id="btn1"
			type="submit" name="submit" value="" />
		</form>
	</div>
</div>
<script>
	function gotoPage(n){
		document.getElementById("txtp").value=n;
		document.getElementById("btn1").click();
	}
</script>
<script>
	function setMenu(n){
		var nav=document.getElementById("navbar");
		var lis=nav.getElementsByTagName("li");
		lis[n].className="current";
	}
</script>
</c:if>
<c:if test="${sessionScope.user==null}">
	<script>
		alert("请登录!");
		location.href="login.jsp";
	</script>
</c:if>